{include app:admin.inc.header}
<!--tmpl-resource-->
{include app:admin.inc.top}


<div class="container-fluid content-body">
	<div class="main">
		<!-- left side start-->
		{include admin.inc.menu}
		<!-- left side end-->


		<!-- main content start-->
		<section class="right-section" id="right-section">
			<!-- start of inner-frame -->
			<div class="inner-iframe">

				<!-- page breadcrumb start-->
				{include admin.inc.bread}
				<!-- page "breadcrumb end-->
				<!-- Nav tabs -->
				<ul class="nav nav-tabs">

					<li><a href="{$add_url}"><i class="glyphicon glyphicon-plus"></i> 添加广告</a></li>
					<li class="active"><a href="javascript:void(0);"><i class="glyphicon glyphicon-th-list"></i> 广告列表</a></li>
					<!--<li><a href="/admin/index/edit"><i class="glyphicon glyphicon-edit"></i> 编辑广告</a></li>-->

				</ul>
				<div class="inner-container">
					<form class="form-inline search-form" role="form"  id="J_List_Form">
						<input type="hidden" name="pagesize" value="{$pagesize}" >
						<!-- searchinput -->
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									广告位置
								</div>
								<select name="s_ad_place_key" class="form-control">
									<option value="0">全部</option>
									{loop $adPlaces $adP}
									<option value="{$adP.key}" {if $s_ad_place_key==$adP['key']}selected{/if}>{$adP.title}</option>
									{/loop}
								</select>
							</div>
						</div>
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									标题
								</div>
								<input type="text" class="form-control input-sm" maxlength="50" placeholder="标题" name="s_title" value="{$s_title}">
							</div>
						</div>
						<!-- searchdatetime -->
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									投放开始时间
								</div>
								<input style="width:100px;" class="form-control form-control-inline input-sm mdate"  size="16" type="text"
								name="s_s_addtime" value="{$s_s_addtime}"
								placeholder="开始时间" />
						
								<div class="input-group-addon">
									-
								</div>
								<input style="width:100px;" class="form-control form-control-inline input-sm mdate"  size="16" type="text"
								name="s_e_addtime" value="{$s_e_addtime}"
								placeholder="结束时间" />
							</div>
						</div>
						
						<!-- searchdatetime -->
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									投放结束时间
								</div>
								<input style="width:100px;" class="form-control form-control-inline input-sm mdate"  size="16" type="text"
								name="s_s_endtime" value="{$s_s_endtime}"
								placeholder="开始时间" />
						
								<div class="input-group-addon">
									-
								</div>
								<input style="width:100px;" class="form-control form-control-inline input-sm mdate"  size="16" type="text"
								name="s_e_endtime" value="{$s_e_endtime}"
								placeholder="结束时间" />
							</div>
						</div>
						
						
						

						<input type="hidden" name="order" value="{$order}">
						<button type="submit" class="btn btn-sm btn-success">搜索</button>
						{run exportBtn()}
						<!-- search form end -->

						<div class="table-responsive">
							<table id="J_ListTable" class="table  table-hover  table-striped">
								<!--tmpl-listtable-->

								<!-- listblock -->
								<thead>
									<tr>
										<th width="20"><input type="checkbox" class="icheck check-all" /></th>
										<!--tmpl-fieldheaders-->
								
										<th>广告位<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="ad_place_id ASC"}ad_place_id DESC{else}ad_place_id ASC{/if}' class='fa ofield {if $order=="ad_place_id ASC"}fa-chevron-up{elseif $order=="ad_place_id DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>标题<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="title ASC"}title DESC{else}title ASC{/if}' class='fa ofield {if $order=="title ASC"}fa-chevron-up{elseif $order=="title DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>内容<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="content ASC"}content DESC{else}content ASC{/if}' class='fa ofield {if $order=="content ASC"}fa-chevron-up{elseif $order=="content DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>描述<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="summary ASC"}summary DESC{else}summary ASC{/if}' class='fa ofield {if $order=="summary ASC"}fa-chevron-up{elseif $order=="summary DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>广告链接<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="link ASC"}link DESC{else}link ASC{/if}' class='fa ofield {if $order=="link ASC"}fa-chevron-up{elseif $order=="link DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>

										<th>打开方式<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="target ASC"}target DESC{else}target ASC{/if}' class='fa ofield {if $order=="target ASC"}fa-chevron-up{elseif $order=="target DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th style="min-width: 110px;">投放开始时间<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="addtime ASC"}addtime DESC{else}addtime ASC{/if}' class='fa ofield {if $order=="addtime ASC"}fa-chevron-up{elseif $order=="addtime DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>

										<th>剩余天数<!--tmpl-orderth-->

										&nbsp;<i class='fa ofield fa-minus' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>投放结束时间<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="endtime ASC"}endtime DESC{else}endtime ASC{/if}' class='fa ofield {if $order=="endtime ASC"}fa-chevron-up{elseif $order=="endtime DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>操作人<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="manager_id ASC"}manager_id DESC{else}manager_id ASC{/if}' class='fa ofield {if $order=="manager_id ASC"}fa-chevron-up{elseif $order=="manager_id DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
								{if empty($items)}
								<tr>
									<td style="text-align:center;" colspan="9" class="empty-table-td">{$emptyRecord}</td>
								</tr>
								{/if}
								{loop $items $value}
								<tr>
									<td><input type="checkbox" class="icheck" name="ids[]" value="{$value[id]}"/></td>
									<!--tmpl-fieldlist-->
								
									<td>{$value[information_ad_place_title]}</td>
									<td>{cut $value[title] 20}</td>
									<td><img src="{$value[content]}" width="100px" /></td>
									<td>{cut $value[summary] 20}</td>
									<td>{cut $value[link] 20}</td>
									<td>{if $value[target] == 0}当前窗口{else}新窗口{/if}</td>
									<td>{expr date("Y-m-d",strtotime($value[addtime]))}</td>
									<td>{$value[remaining_time]}</td>
									<td>{if intval($value[endtime]) ==0 }永久{else}{expr date("Y-m-d",strtotime($value[endtime]))}{/if} </td>
									<td>{$value[admin_manager_username]}</td>
								
									<td>
										<!--tmpl-listbtn-->
								
										<!-- listbtnedit -->
										{if in_array('admin/ad/edit',$priv) || empty($priv)}
										<a href="{$edit_url}?id={$value[id]}" class="btn btn-primary btn-xs">
											<i class="glyphicon glyphicon-edit"></i> 编辑</a>
										{/if}
										<!-- listbtndelete -->
										{if in_array('admin/ad/delete',$priv) || empty($priv)}
										<a href="{$delete_url}?id={$value[id]}" class="btn btn-danger btn-xs item-remove">
											<i class="glyphicon glyphicon-trash"></i> 删除</a>
										{/if}
									</td>
								</tr>
								{/loop}
								</tbody>
							</table>
						</div>
					</form>
					<div class="btn-group dropup" data-act="operateAll">
						<button type="button" class="btn btn-danger js-deletes" disabled>批量删除</button>
					</div>
					<div class="text-right">
						{$pagemenu}
					</div>

				</div>
			</div>
		</section>
	</div>
</div>

<!--footer section start-->
{include admin.inc.footer}
<!--footer section end-->

<!--tmpl-script-->

<!-- template -->
<script id="editpanel" type="text/html">
	<div>
		<form id="editpanel-form" class="form-horizontal">
			<div class="row">&nbsp</div>
			<!--tmpl-fieldlist-->

			<!-- input -->
			<div class="form-group">
				<label >广告位 </label>
				<input  dtype="" class="form-control" maxlength="{maxlength}" name="data[ad_place_id]" placeholder="广告位" required cname="广告位" value="{[ad_place_id]}" />
			</div>
			<p class="help-block"></p>
			
			<!-- input -->
			<div class="form-group">
				<label >标题 </label>
				<input  dtype="" class="form-control" maxlength="50" name="data[title]" placeholder="标题" required cname="标题" value="{[title]}" />
			</div>
			<p class="help-block"></p>
			
			<!-- textarea -->
			<div class="form-group">
				<label>内容</label>
				<textarea class="form-control" maxlength="255" name="data[content]" placeholder="内容" required cname="内容">{[content]}</textarea>
			</div>
			<p class="help-block"></p>
			
			<!-- input -->
			<div class="form-group">
				<label >描述 </label>
				<input  dtype="" class="form-control" maxlength="255" name="data[summary]" placeholder="描述" required cname="描述" value="{[summary]}" />
			</div>
			<p class="help-block"></p>
			
			<!-- input -->
			<div class="form-group">
				<label >广告链接 </label>
				<input  dtype="" class="form-control" maxlength="255" name="data[link]" placeholder="广告链接" required cname="广告链接" value="{[link]}" />
			</div>
			<p class="help-block"></p>
			
			<!-- input -->
			<div class="form-group">
				<label >打开方式 </label>
				<input  dtype="" class="form-control" maxlength="{maxlength}" name="data[target]" placeholder="打开方式" required cname="打开方式" value="{[target]}" />
			</div>
			<p class="help-block"></p>
			

			<!--tmpl-assocfields-->
		</form>
	</div>
</script>

<!-- pagescript -->
<script type="text/javascript">
	seajs.use("admin/information_adindex",function (parameter){
		
		/**--tmpl-templatejavascript--**/
		
		<!--tmpl-templatejavascript-->
		parameter.detailUrl="{$detail_url}";
		parameter.deleteUrl="{$delete_url}";
		parameter.editUrl="{$do_edit_url}";
		parameter.upload_url="{$upload_url}";
		parameter.image_search_url="{$image_search_url}";
		parameter.image_list_url="{$image_list_url}";
		
		parameter.init();		
	});
</script>


<script id="assocpage" type="text/html">
<div class="text-right">
	<ul class="pagination blog-pagination">
		<li><a class="assoc-page" data-page="{[prev]}" href="javascript:void(0);">上一页</a></li> 
		{[loop pages page]}

		<li {[if curr == page]}class="active"{[/if]}><a class="assoc-page" data-page="{[page]}"  href="javascript:void(0)">{[page]}</a></li> 

		{[/loop]}
		<li><a class="assoc-page" href="javascript:void(0);" data-page="{[nexts]}">下一页</a></li> 
	</ul>	
</div>
</script>
</body>
</html>
